package top.api.utils;

import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;

public class AssertUtil {
    public static void isNull(Object obj,String msg){
        if (ObjectUtils.isNull(obj)){
            throw new RuntimeException(StringUtils.isBlank(msg)?"数据为空":msg);
        }
    }

    public static void isTrue(boolean flag,String msg){
        if (flag){
            throw new RuntimeException(StringUtils.isBlank(msg)?"数据为空":msg);
        }
    }
}
